{% extends 'layout.html' %}


{% block content %}
    {% load my_tags %}



    <form action="" method="post" class="form-inline">
        {% csrf_token %}
        {{ formset_obj.management_form }}

        <table class="table table-bordered table-hover">
            <thead>
            <tr>

                <th>序号</th>
                <th>学生姓名</th>
                <th>考勤</th>
                <th>成绩</th>
                <th>作业批语</th>

            </tr>
            </thead>
            <tbody>

            {% for form in formset_obj %}
                <tr>
                    {{ form.id }}
                    <td>{{ forloop.counter }}</td>
                    <td>{{ form.instance.student }}</td>
                    <td>{{ form.attendance }}</td>
                    <td>{{ form.score }}</td>
                    <td>{{ form.homework_note }}</td>
                    <td class="hidden">{{ form.student }}</td>
                    <td class="hidden">{{ form.course_record }}</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <button class="btn btn-sm btn-primary">保存</button>
    </form>

    <nav aria-label="Page navigation">
        <ul class="pagination">
            {{ page_html|safe }}
        </ul>
    </nav>

{% endblock %}